<?php

namespace Biz\model\brand;

use Doraemon\pockets\datebase\BaseDbModel;

/**
 * 品牌基础信息审核日志表
 *
 * @category   Module name
 * @package    PSR
 * @subpackage Documentation\API
 * @author     zhouyang  <zhouyang@haohaozhu.com>
 * @license    GPL http://www.haohaozhu.com
 * @link       http://www.haohaozhu.com
 */

class BrandInfoAuditLog extends BaseDbModel
{
    const _CONFIG_FILE_ = 'db_store';

    const _CONFIG_SELECT_ = 'db_store';

    const _DATABASE_ = 'store';

    const _TABLE_NAME = 'brand_info_audit_log';

    const _SUB_TABLE = false;

    // 审核状态（0：审核中；1：审核通过；2：未通过）
    const AUDIT_STATUS_WAIT = 0;
    const AUDIT_STATUS_PASS = 1;
    const AUDIT_STATUS_FAIL = 2;

    const AUDIT_STATUS = [
        0 => '待审核',
        1 => '审核通过',
        2 => '审核未通过',
    ];

    public static function lists($condition, $page, $limit)
    {
        $map['AND'] = $condition;
        $map['ORDER'] = array(
            'add_time' => 'DESC'
        );
        $map['LIMIT'] =  [($page - 1) * $limit, $limit];

        return self::select("*", $map);
    }
}
